// components/Header/Header.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: String,
    back: Boolean,
    headerHr: Boolean,
    titleColor: String,
    bgColor: String,
  },
  // #F54B64
  /**
   * 组件的初始数据
   */
  data: {
    statusBarHeight: 20,
    headHeight: 60,
  },
  attached() {
    wx.getSystemInfo({
      success: (res) => {
        let info = wx.getMenuButtonBoundingClientRect();
        let headHeight = info.height + info.top * 2 - res.statusBarHeight;
        this.setData({
          statusBarHeight: res.statusBarHeight,
          headHeight: headHeight
        })
      }
    })
  },




  /**
   * 组件的方法列表
   */
  methods: {
    goBack(){
      wx.navigateBack({
        delta: 1
      })
    }
  }
})